using System;
using Aluetjen.EmailService.Domain.Models;
using Aluetjen.EmailService.Domain.Models.Message;
using Aluetjen.EmailService.Domain.Models.Pipeline;
using FluentNHibernate.Automapping;

namespace Aluetjen.EmailService.Infrastructure.Persistence.Mappings
{
    public class ModelAutomappingConfiguration : DefaultAutomappingConfiguration
    {
        public override bool ShouldMap(Type type)
        {
            return type.IsSubclassOf(typeof(Entity)) &&
                type != typeof(MailMessage) &&
                type != typeof(Attachment);
        }

        public override bool IsComponent(Type type)
        {
            return type == typeof(Condition);
        }
    }
}